﻿using System.Collections.Generic;

namespace Sidvall.Data
{
    public abstract class CriteriaBase : ICriteria
    {
        #region Public Members

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public ParameterCollection Parameters { get; set; }
        public string CriteriaId { get; set; }

        #region Clean

        public virtual void Clean(IEnumerable<string> validParameterKeys)
        {
            if (this.Parameters != null)
                this.Parameters.RemoveAllExcept(validParameterKeys);
        }

        #endregion
        #region Clear

        public virtual void Clear()
        {
            this.Parameters = null;
        }

        #endregion

        #endregion
    }
}
